<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>

</body>
<script>

  // const msg = "张三";

  // const str1 = "今天"+ msg +"真好";
  // console.log(str1);;

  // const str2 = `今
  // 天
  // ${msg}
  // 真
  // 好
  // `;
  // console.log(str2);

  // const str3 = '<div class="box">' + 
  //               '<img src="" alt="">' +
  //             '</div>';
  // console.log(str3)

  // const str4 = `<div class="box">
  //                 <img src="" alt="">
  //               </div>`;
  // console.log(str4)


  // ========


  const str = "hello world";

  // console.log( str.indexOf("o") !== -1 );
  // console.log( str.includes("o") );
  // console.log( str.includes("a") );

  // console.log( str.startsWith("he") );
  // console.log( str.startsWith("e") );
  
  // console.log( str.endsWith("d") );
  // console.log( str.endsWith("a") );

  // console.log( str.repeat(5) );

  // 字符编码Unicode

  // 𠮶

  // 之前版本的字符编码的转换
  console.log("龍".charCodeAt())
  console.log("龍".length)
  console.log(String.fromCharCode(40845))
  // 不支持生僻字
  console.log("𠮶".length);
  console.log("𠮶".charCodeAt(0));
  console.log("𠮶".charCodeAt(1));
  console.log(String.fromCharCode(55362, 57270));

  // 新增的字符编码的转换（支持常用字和生僻字）
  console.log( "龍".codePointAt() );
  console.log(String.fromCodePoint(40845));
  console.log( "𠮶".codePointAt() );
  console.log(String.fromCodePoint(134070));
  
  // =========
  
  // console.log( "\u{20bb6}" )

  




</script>
</html>